

#include <stdio.h>
#include <stdbool.h>
bool isPalindrome(int x) 
{
    if(x < 0 || (x%10 == 0 && x != 0))
    return false;
    int sum = 0;
    while(sum < x)
    {
        sum = sum * 10 + x % 10;
        x = x / 10;
    } 
    if(sum == x || sum / 10 == x)
    return true;
    return false;   
}  

int main()
{
    int x;
    printf("请输入一个整数\n");
    scanf("%d",&x);
    if(isPalindrome(x) == 1)
    printf("%d是回文数\n",x);
    else
    printf("%d不是回文数\n",x);
    return 0;
}